using System;
using System.Collections.Generic;
using Castle.ActiveRecord;
using CosyTrade.Data;

namespace CosyTrade.Distribution
{
    [AddPropertyChangedNotifyInterface, PropertyChangedNotify]
    [Serializable, ActiveRecord("tbClientCategoryDetail")]
    public class ClientCategory : ClientCategoryBase
    {
        [JoinedKey("ROWGUID")]
        public Guid RelationKey
        {
            get { return PrimaryKey; }
        }

        private readonly IList<ClientCategoryBase> childsCategory = new List<ClientCategoryBase>();
        [HasMany(typeof(ClientCategoryBase), ColumnKey = "Childs", Table = "tbClientCategoryDetail",Cascade = ManyRelationCascadeEnum.Delete,Access = PropertyAccess.NosetterCamelcase)]
        public IList<ClientCategoryBase> ChildsCategory
        {
            get { return childsCategory; }
        }
    }
}